home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / GameKit / Palettes / GameInfoPalette / GameInfoInspector.m < prev    next >
Text File  |  1995-06-12  |  2KB  |  49 lines

  1. #import "GameInfoInspector.h"
  2. #import <appkit/appkit.h>
  3. #import "GameInfo.h"
  4.  
  5. @implementation GameInfoInspector
  6.  
  7. - init
  8. {
  9.     char buf[MAXPATHLEN + 1];
  10.     id bundle;
  11.     
  12.     [super init];
  13.     bundle = [NXBundle bundleForClass:[GameInfo class]];
  14.     [bundle getPath:buf forResource:"GameInfoInspector" ofType:"nib"];
  15.     [NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]];
  16.     return self;
  17. }
  18.  
  19. - (BOOL)wantsButtons { return YES; }
  20.  
  21. - revert:sender
  22. {
  23.     // Put string in text object
  24.     [numSoundsText        setIntValue:[object numSounds]];
  25.     [numTypesText        setIntValue:[object numSoundTypes]];
  26.     [numStreamsText        setIntValue:[object numSoundStreams]];
  27.     [maxHighScoresText    setIntValue:[object maxHighScores]];
  28.     [numTablesText        setIntValue:[object numHighScoreTables]];
  29.     [numOneUpsText        setIntValue:[object numOneUps]];
  30.     [slotTypeText     setStringValue:[[object slotType] stringValue]];
  31.     [passwordText     setStringValue:[[object encryptedPassword] stringValue]];
  32.     return [super revert:sender];
  33. }
  34.  
  35. - ok:sender
  36. {
  37.     [object setnumSoundTypes:        [numTypesText        intValue]];
  38.     [object setnumSoundStreams:        [numStreamsText        intValue]];
  39.     [object setnumSounds:            [numSoundsText        intValue]];
  40.     [object setnumHighScoreTables:    [numTablesText        intValue]];
  41.     [object setMaxHighScores:        [maxHighScoresText    intValue]];
  42.     [object setNumOneUps:            [numOneUpsText        intValue]];
  43.     [object setSlotType:            [slotTypeText        stringValue]];
  44.     [object setEncryptedPassword:    [passwordText        stringValue]];
  45.     return [super ok:sender];
  46. }
  47.  
  48. @end
  49.